import { FC, memo, useState } from 'react';

// `React.memo` is needed for function component
const Example: FC = memo(() => {
  const [ count, setCount ] = useState(0);
  return (
    <div>
      <h1>Example {count}</h1>
      <div>
        <button onClick={() => setCount((n) => n + 1)}>Increase</button>
      </div>
    </div>
  );
});

Example.whyDidYouRender = true;
export default Example;
